package com.itheima.user.controller.v1;

import com.itheima.model.common.dtos.ResponseResult;
import com.itheima.model.user.dtos.LoginDto;
import com.itheima.model.user.dtos.SignDto;
import com.itheima.user.service.UserService;
import com.itheima.user.service.impl.SignServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sign")
@Api(value = "用户签到",tags = "用户签到")
public class SignController {
    @Autowired
    private SignServiceImpl signService;

    /**
     * 获取用户签到数据
     * @return
     */
    @GetMapping
    @ApiOperation("获取用户签到数据")
    public ResponseResult getSignData(){
        return signService.getSignData();
    }

    /**
     * 保存签到数据
     * @param dto
     * @return
     */
    @PostMapping
    @ApiOperation("保存签到数据")
    public ResponseResult saveSignData(@RequestBody SignDto dto){
        return signService.saveSignData(dto);
    }
}
